/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gob.cgr.sgrh.ejb.entidad;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MICROSOF
 */
@Entity
@Table(name = "maestra")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Maestra.findAll", query = "SELECT m FROM Maestra m"),
    @NamedQuery(name = "Maestra.findByIdMaestra", query = "SELECT m FROM Maestra m WHERE m.idMaestra = :idMaestra"),
    @NamedQuery(name = "Maestra.findByTabla", query = "SELECT m FROM Maestra m WHERE m.tabla = :tabla"),
    @NamedQuery(name = "Maestra.findByCampo", query = "SELECT m FROM Maestra m WHERE m.campo = :campo"),
    @NamedQuery(name = "Maestra.findByDescripcion", query = "SELECT m FROM Maestra m WHERE m.descripcion = :descripcion"),
    @NamedQuery(name = "Maestra.findByEstado", query = "SELECT m FROM Maestra m WHERE m.estado = :estado")})
public class Maestra implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_MAESTRA")
    private Integer idMaestra;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "TABLA")
    private String tabla;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "CAMPO")
    private String campo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "VALOR")
    private String valor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @Size(max = 10)
    @Column(name = "ESTADO")
    private String estado;

    public Maestra() {
    }

    public Maestra(Integer idMaestra) {
        this.idMaestra = idMaestra;
    }

    public Maestra(Integer idMaestra, String tabla, String campo, String idDetalle, String descripcion) {
        this.idMaestra = idMaestra;
        this.tabla = tabla;
        this.campo = campo;
        this.valor = idDetalle;
        this.descripcion = descripcion;
    }

    public Integer getIdMaestra() {
        return idMaestra;
    }

    public void setIdMaestra(Integer idMaestra) {
        this.idMaestra = idMaestra;
    }

    public String getTabla() {
        return tabla;
    }

    public void setTabla(String tabla) {
        this.tabla = tabla;
    }

    public String getCampo() {
        return campo;
    }

    public void setCampo(String campo) {
        this.campo = campo;
    }

    public String getValor() {
        return valor;
    }

    public void setValor(String idDetalle) {
        this.valor = idDetalle;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMaestra != null ? idMaestra.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Maestra)) {
            return false;
        }
        Maestra other = (Maestra) object;
        if ((this.idMaestra == null && other.idMaestra != null) || (this.idMaestra != null && !this.idMaestra.equals(other.idMaestra))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gob.cgr.sgrh.ejb.entidad.Maestra[ idMaestra=" + idMaestra + " ]";
    }
    
}
